package controller

import (
	"fmt"
	"github.com/gin-gonic/gin"
)

/**
路由
*/
func Home(r *gin.Engine) {
	home := r.Group("/")

	router := home.Group("/api")
	{
		foodCategory := new(FoodCategoryController)
		router.GET("/food_category", foodCategory.FoodCategory)
	}
	{
		good := new(GoodController)
		router.GET("/foods", good.GetGoods)
	}
	{
		hello := new(HelloController)
		router.GET("/hello", hello.Hello)
	}
	{
		member := new(MemberController)
		router.GET("/sendcode", member.SendSmsCode)
		router.POST("/login_sms", member.SmsLogin)
		//验证码调用
		router.GET("/captcha", member.Captcha)
		//postman测试	验证验证码
		router.POST("/vertifycha", member.VertifyCaptcha)
		//login_pwd
		router.POST("/login_pwd", member.NameLogin)

		//头像上传
		router.POST("/upload/avator", member.UploadAvator)

		//用户信息查询
		router.GET("/userinfo", member.UserInfo)
	}

	fmt.Println(home)
}
